<layout name="layout"/>
<div class="form-div">
    <form action=__ACTION__ method="get" name="searchForm">
        <img src="__PUBLIC__/Admin/Images/icon_search.gif" width="26" height="22" border="0" alt="search" />
        <!-- 分类 -->
        <p>
            商品名称：
            <input type="text" value="<?php echo I('get.gn'); ?>" name="gn" size="60"/>
        </p>
        <p>
            分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类：
            <?php
                $catId = I('get.cat_id'); ?>
            <select name="cat_id">
                <option value="">选择分类</option>
                <?php foreach($catData as $k=>$v):
                    if($v['id'] == $catId)
                        $select = 'selected="selected"';
                    else
                        $select = '';
                ?>
                <option <?php echo $select; ?> value="<?php echo $v['id']; ?>"><?php echo str_repeat('-',8*$v['level']).$v['cat_name']; ?></option>
                <?php endforeach; ?>
            </select>
        </p>
        <p>
            品&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;牌：
            <?php buildSelect('brand','brand_id','id','brand_name',I('get.brand_id')); ?>
        </p>
        <p>
            价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 格：
            从<input type="text" value="<?php echo I('get.fp'); ?>" name="fp" size="8"/>
            到<input type="text" value="<?php echo I('get.tp'); ?>" name="tp" size="8"/>
        </p>
        <p>
            是否上架：
            <?php $ios = I('get.ios'); ?>
            <input type="radio" name="ios" value="" <?php if($ios == '') echo 'checked="checked"'; ?>/>全部
            <input type="radio" name="ios" value="1" <?php if($ios == '1') echo 'checked="checked"'; ?>/>上架
            <input type="radio" name="ios" value="0" <?php if($ios == '0') echo 'checked="checked"'; ?>/>下架
        </p>
        <p>
            添加时间：
            从<input type="text" id='fa' value="<?php echo I('get.fa'); ?>" name="fa" size="20"/>
            到<input type="text" id='ta' value="<?php echo I('get.ta'); ?>" name="ta" size="20"/>
        </p>
        <p>
            排序方式：
            <?php $obdy = I('get.odby','id_desc'); ?>
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="id_desc"<?php if($obdy == 'id_desc') echo 'checked="checked"'; ?>/>商品编号降序
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="id_asc"<?php if($obdy == 'id_asc') echo 'checked="checked"'; ?>/>商品编号升序
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="price_desc"<?php if($obdy == 'price_desc') echo 'checked="checked"'; ?>/>价格从高到低
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="price_asc"<?php if($obdy == 'price_asc') echo 'checked="checked"'; ?>/>价格从低到高

        </p>
        <button type="submit" class="btn btn-success">搜索</button>
    </form>
</div>

<!-- 商品列表 -->
<form method="post" action="" name="listForm" onsubmit="">
    <div class="list-div" id="listDiv">
        <table cellpadding="3" cellspacing="1" class="table table-hover">
            <thead >
                <tr class="success">
                    <th>编号</th>
                    <th width="15%">商品名称</th>
                    <th>主分类</th>
                    <th>扩展分类</th>
                    <th>品牌</th>

                    <th>本店价格</th>
                    <th>市场价格</th>
                    <th>上架</th>
                    <th>Logo</th>
                    <th>添加时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <foreach name="data" item="val">
                <tbody>
                    <tr class="tron">
                        <td >{$val.id}</td>
                        <td ><span>{$val.goods_name}</span></td>
                        <td>{$val.cat_name}</td>
                        <td>{$val.ext_cat_name}</td>
                        <td ><span value="{$val.id}">{$val.brand_name}</span></td>

                        <td><span>{$val.shop_price}</span></td>
                        <td><span>{$val.market_price}</span></td>
                        <td><img src="<if condition='($val.is_onsale eq 1)'> __PUBLIC__/Admin/Images/yes.gif <else/> __PUBLIC__/Admin/Images/no.gif </if>"/></td>
                        <td><?php showImage($val['sm_logo']); ?></td>
                        <td>{$val.addtime}</td>
                        <td>
                            <a href="{:U('Goods/goods_number')}?id={$val.id}"  title="查看库存"><img src="__PUBLIC__/Admin/Images/icon_view.gif" width="16" height="16" border="0" /></a>
                            <a href="{:U('Goods/edit')}?id={$val.id}" title="编辑"><img src="__PUBLIC__/Admin/Images/icon_edit.gif" width="16" height="16" border="0" /></a>
                            <a href="{:U('Goods/del')}?id={$val.id}" onclick="return confirm('确定删除吗')" title="回收站"><img src="__PUBLIC__/Admin/Images/icon_trash.gif" width="16" height="16" border="0" /></a></td>
                    </tr>
                </tbody>
            </foreach>
        </table>
    </div>
    <nav style="text-align: center">
        <ul class="pagination">
            {$page}
        </ul>
    </nav>
</form>

<div id="footer">
    共执行 7 个查询，用时 0.028849 秒，Gzip 已禁用，内存占用 3.219 MB<br />
    版权所有 &copy; 2005-2012 上海商派网络科技有限公司，并保留所有权利。</div>
<link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="__PUBLIC__/bootstrap/js/bootstrap.min.js"></script>
<!--时间插件-->
<link href="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/datepicker-zh_cn.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.css" />
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/i18n/jquery-ui-timepicker-addon-i18n.min.js"></script>
<script>
// 添加时间插件
    $.timepicker.setDefaults($.timepicker.regional['zh-CN']);  // 设置使用中文

    $("#fa").datetimepicker();
    $("#ta").datetimepicker();
</script>

<!-- 引入行高亮显示 -->
<script type="text/javascript" src="__PUBLIC__/Admin/Js/tron.js"></script>
